<template>
  <div>
    <button @click="addnum">123</button>
    {{ list }}
  </div>
</template>
<script>
// import { toRefs } from "vue";
import { getMoviesmore } from "../untils/api.js";
export default {
  methods: {
    async getlist() {
      const res = await getMoviesmore({ id: 1 });
      console.log(res);
    },
  },
    mounted() {
    this.getlist();
  },
  //接收父组件中自定义属性list
  props: ["list"],
  setup(props, context) {
    //通过定义触发父组件中自定义事件Add
    const addnum = () => {
      context.emit("Add", 22);
    };

    console.log("props", props);
    // const { list } = toRefs(props);
    // console.log(list)
    return {
      addnum,
    };
  },
};
</script>
